.class public Lorg/springframework/beans/BeanUtils;
.super Ljava/lang/Object;
.source "BeanUtils.java"


# direct methods
.method public constructor <init>()V
    .locals 0

    .prologue
    .line 13
    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    return-void
.end method

.method public static convertToBean(Ljava/lang/String;Ljava/lang/Class;)Ljava/lang/Object;
    .locals 1
    .parameter "value"
    .parameter
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "<T:",
            "Ljava/lang/Object;",
            ">(",
            "Ljava/lang/String;",
            "Ljava/lang/Class",
            "<TT;>;)TT;"
        }
    .end annotation

    .prologue
    .line 23
    .local p1, clazz:Ljava/lang/Class;,"Ljava/lang/Class<TT;>;"
    const-class v0, Ljava/lang/String;

    invoke-virtual {v0, p1}, Ljava/lang/Class;->isAssignableFrom(Ljava/lang/Class;)Z

    move-result v0

    if-eqz v0, :cond_0

    .line 24
    new-instance v0, Ljava/lang/String;

    invoke-direct {v0, p0}, Ljava/lang/String;-><init>(Ljava/lang/String;)V

    .line 47
    :goto_0
    return-object v0

    .line 26
    :cond_0
    const-class v0, Ljava/lang/Integer;

    invoke-virtual {v0, p1}, Ljava/lang/Class;->isAssignableFrom(Ljava/lang/Class;)Z

    move-result v0

    if-nez v0, :cond_1

    .line 27
    sget-object v0, Ljava/lang/Integer;->TYPE:Ljava/lang/Class;

    invoke-virtual {v0, p1}, Ljava/lang/Class;->isAssignableFrom(Ljava/lang/Class;)Z

    move-result v0

    if-eqz v0, :cond_2

    .line 28
    :cond_1
    new-instance v0, Ljava/lang/Integer;

    invoke-direct {v0, p0}, Ljava/lang/Integer;-><init>(Ljava/lang/String;)V

    goto :goto_0

    .line 30
    :cond_2
    const-class v0, Ljava/lang/Long;

    invoke-virtual {v0, p1}, Ljava/lang/Class;->isAssignableFrom(Ljava/lang/Class;)Z

    move-result v0

    if-nez v0, :cond_3

    .line 31
    sget-object v0, Ljava/lang/Long;->TYPE:Ljava/lang/Class;

    invoke-virtual {v0, p1}, Ljava/lang/Class;->isAssignableFrom(Ljava/lang/Class;)Z

    move-result v0

    if-eqz v0, :cond_4

    .line 32
    :cond_3
    new-instance v0, Ljava/lang/Long;

    invoke-direct {v0, p0}, Ljava/lang/Long;-><init>(Ljava/lang/String;)V

    goto :goto_0

    .line 34
    :cond_4
    const-class v0, Ljava/lang/Float;

    invoke-virtual {v0, p1}, Ljava/lang/Class;->isAssignableFrom(Ljava/lang/Class;)Z

    move-result v0

    if-nez v0, :cond_5

    .line 35
    sget-object v0, Ljava/lang/Float;->TYPE:Ljava/lang/Class;

    invoke-virtual {v0, p1}, Ljava/lang/Class;->isAssignableFrom(Ljava/lang/Class;)Z

    move-result v0

    if-eqz v0, :cond_6

    .line 36
    :cond_5
    new-instance v0, Ljava/lang/Float;

    invoke-direct {v0, p0}, Ljava/lang/Float;-><init>(Ljava/lang/String;)V

    goto :goto_0

    .line 38
    :cond_6
    const-class v0, Ljava/lang/Double;

    invoke-virtual {v0, p1}, Ljava/lang/Class;->isAssignableFrom(Ljava/lang/Class;)Z

    move-result v0

    if-nez v0, :cond_7

    .line 39
    sget-object v0, Ljava/lang/Double;->TYPE:Ljava/lang/Class;

    invoke-virtual {v0, p1}, Ljava/lang/Class;->isAssignableFrom(Ljava/lang/Class;)Z

    move-result v0

    if-eqz v0, :cond_8

    .line 40
    :cond_7
    new-instance v0, Ljava/lang/Double;

    invoke-direct {v0, p0}, Ljava/lang/Double;-><init>(Ljava/lang/String;)V

    goto :goto_0

    .line 42
    :cond_8
    const-class v0, Ljava/lang/Boolean;

    invoke-virtual {v0, p1}, Ljava/lang/Class;->isAssignableFrom(Ljava/lang/Class;)Z

    move-result v0

    if-nez v0, :cond_9

    .line 43
    sget-object v0, Ljava/lang/Boolean;->TYPE:Ljava/lang/Class;

    invoke-virtual {v0, p1}, Ljava/lang/Class;->isAssignableFrom(Ljava/lang/Class;)Z

    move-result v0

    if-eqz v0, :cond_a

    .line 44
    :cond_9
    new-instance v0, Ljava/lang/Boolean;

    invoke-direct {v0, p0}, Ljava/lang/Boolean;-><init>(Ljava/lang/String;)V

    goto :goto_0

    .line 47
    :cond_a
    const/4 v0, 0x0

    goto :goto_0
.end method

.method public static convertToBean(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/Object;
    .locals 1
    .parameter "value"
    .parameter "clazz"
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "<T:",
            "Ljava/lang/Object;",
            ">(",
            "Ljava/lang/String;",
            "Ljava/lang/String;",
            ")TT;"
        }
    .end annotation

    .prologue
    .line 17
    invoke-static {p1}, Lorg/springframework/beans/BeanUtils;->getClass(Ljava/lang/String;)Ljava/lang/Class;

    move-result-object v0

    invoke-static {p0, v0}, Lorg/springframework/beans/BeanUtils;->convertToBean(Ljava/lang/String;Ljava/lang/Class;)Ljava/lang/Object;

    move-result-object v0

    return-object v0
.end method

.method public static getClass(Ljava/lang/String;)Ljava/lang/Class;
    .locals 4
    .parameter "clazzName"
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "<T:",
            "Ljava/lang/Object;",
            ">(",
            "Ljava/lang/String;",
            ")",
            "Ljava/lang/Class",
            "<TT;>;"
        }
    .end annotation

    .annotation system Ldalvik/annotation/Throws;
        value = {
            Lorg/springframework/beans/BeanInstantiationException;
        }
    .end annotation

    .prologue
    .line 54
    :try_start_0
    invoke-static {p0}, Ljava/lang/Class;->forName(Ljava/lang/String;)Ljava/lang/Class;
    :try_end_0
    .catch Ljava/lang/ClassNotFoundException; {:try_start_0 .. :try_end_0} :catch_0

    move-result-object v1

    return-object v1

    .line 55
    :catch_0
    move-exception v0

    .line 56
    .local v0, exp:Ljava/lang/ClassNotFoundException;
    new-instance v1, Lorg/springframework/beans/FatalBeanException;

    .line 57
    new-instance v2, Ljava/lang/StringBuilder;

    const-string v3, "Could not find class: "

    invoke-direct {v2, v3}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    invoke-virtual {v2, p0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v2

    invoke-virtual {v2}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v2

    .line 56
    invoke-direct {v1, v2, v0}, Lorg/springframework/beans/FatalBeanException;-><init>(Ljava/lang/String;Ljava/lang/Throwable;)V

    throw v1
.end method

.method public static instantiate(Ljava/lang/Class;)Ljava/lang/Object;
    .locals 3
    .parameter
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "<T:",
            "Ljava/lang/Object;",
            ">(",
            "Ljava/lang/Class",
            "<TT;>;)TT;"
        }
    .end annotation

    .annotation system Ldalvik/annotation/Throws;
        value = {
            Lorg/springframework/beans/BeanInstantiationException;
        }
    .end annotation

    .prologue
    .line 70
    .local p0, clazz:Ljava/lang/Class;,"Ljava/lang/Class<TT;>;"
    invoke-virtual {p0}, Ljava/lang/Class;->isInterface()Z

    move-result v1

    if-eqz v1, :cond_0

    .line 71
    new-instance v1, Lorg/springframework/beans/BeanInstantiationException;

    const-string v2, "Specified class is an interface"

    invoke-direct {v1, p0, v2}, Lorg/springframework/beans/BeanInstantiationException;-><init>(Ljava/lang/Class;Ljava/lang/String;)V

    throw v1

    .line 74
    :cond_0
    :try_start_0
    invoke-virtual {p0}, Ljava/lang/Class;->newInstance()Ljava/lang/Object;
    :try_end_0
    .catch Ljava/lang/InstantiationException; {:try_start_0 .. :try_end_0} :catch_0
    .catch Ljava/lang/IllegalAccessException; {:try_start_0 .. :try_end_0} :catch_1

    move-result-object v1

    return-object v1

    .line 76
    :catch_0
    move-exception v0

    .line 77
    .local v0, ex:Ljava/lang/InstantiationException;
    new-instance v1, Lorg/springframework/beans/BeanInstantiationException;

    const-string v2, "Is it an abstract class?"

    invoke-direct {v1, p0, v2, v0}, Lorg/springframework/beans/BeanInstantiationException;-><init>(Ljava/lang/Class;Ljava/lang/String;Ljava/lang/Throwable;)V

    throw v1

    .line 79
    .end local v0           #ex:Ljava/lang/InstantiationException;
    :catch_1
    move-exception v0

    .line 80
    .local v0, ex:Ljava/lang/IllegalAccessException;
    new-instance v1, Lorg/springframework/beans/BeanInstantiationException;

    const-string v2, "Is the constructor accessible?"

    invoke-direct {v1, p0, v2, v0}, Lorg/springframework/beans/BeanInstantiationException;-><init>(Ljava/lang/Class;Ljava/lang/String;Ljava/lang/Throwable;)V

    throw v1
.end method

.method public static varargs instantiateClass(Ljava/lang/Class;[Ljava/lang/Object;)Ljava/lang/Object;
    .locals 6
    .parameter
    .parameter "args"
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "<T:",
            "Ljava/lang/Object;",
            ">(",
            "Ljava/lang/Class",
            "<TT;>;[",
            "Ljava/lang/Object;",
            ")TT;"
        }
    .end annotation

    .annotation system Ldalvik/annotation/Throws;
        value = {
            Lorg/springframework/beans/BeanInstantiationException;
        }
    .end annotation

    .prologue
    .line 97
    .local p0, clazz:Ljava/lang/Class;,"Ljava/lang/Class<TT;>;"
    const-string v2, "Class must not be null"

    invoke-static {p0, v2}, Lorg/springframework/util/Assert;->notNull(Ljava/lang/Object;Ljava/lang/String;)V

    .line 98
    const/4 v0, 0x0

    .line 100
    .local v0, ctor:Ljava/lang/reflect/Constructor;,"Ljava/lang/reflect/Constructor<TT;>;"
    :try_start_0
    array-length v2, p1

    invoke-static {v2}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;

    move-result-object v2

    invoke-static {p0, v2}, Lcom/h2/util/lang/reflect/ReflectUtils;->getConstructor(Ljava/lang/Class;Ljava/lang/Integer;)Ljava/lang/reflect/Constructor;

    move-result-object v0

    .line 101
    invoke-virtual {v0, p1}, Ljava/lang/reflect/Constructor;->newInstance([Ljava/lang/Object;)Ljava/lang/Object;
    :try_end_0
    .catch Ljava/lang/InstantiationException; {:try_start_0 .. :try_end_0} :catch_0
    .catch Ljava/lang/IllegalAccessException; {:try_start_0 .. :try_end_0} :catch_1
    .catch Ljava/lang/IllegalArgumentException; {:try_start_0 .. :try_end_0} :catch_2
    .catch Ljava/lang/reflect/InvocationTargetException; {:try_start_0 .. :try_end_0} :catch_3

    move-result-object v2

    return-object v2

    .line 103
    :catch_0
    move-exception v1

    .line 104
    .local v1, ex:Ljava/lang/InstantiationException;
    new-instance v2, Lorg/springframework/beans/BeanInstantiationException;

    invoke-virtual {v0}, Ljava/lang/reflect/Constructor;->getDeclaringClass()Ljava/lang/Class;

    move-result-object v3

    .line 105
    const-string v4, "Is it an abstract class?"

    .line 104
    invoke-direct {v2, v3, v4, v1}, Lorg/springframework/beans/BeanInstantiationException;-><init>(Ljava/lang/Class;Ljava/lang/String;Ljava/lang/Throwable;)V

    throw v2

    .line 107
    .end local v1           #ex:Ljava/lang/InstantiationException;
    :catch_1
    move-exception v1

    .line 108
    .local v1, ex:Ljava/lang/IllegalAccessException;
    new-instance v2, Lorg/springframework/beans/BeanInstantiationException;

    invoke-virtual {v0}, Ljava/lang/reflect/Constructor;->getDeclaringClass()Ljava/lang/Class;

    move-result-object v3

    .line 109
    const-string v4, "Is the constructor accessible?"

    .line 108
    invoke-direct {v2, v3, v4, v1}, Lorg/springframework/beans/BeanInstantiationException;-><init>(Ljava/lang/Class;Ljava/lang/String;Ljava/lang/Throwable;)V

    throw v2

    .line 111
    .end local v1           #ex:Ljava/lang/IllegalAccessException;
    :catch_2
    move-exception v1

    .line 112
    .local v1, ex:Ljava/lang/IllegalArgumentException;
    new-instance v2, Lorg/springframework/beans/BeanInstantiationException;

    invoke-virtual {v0}, Ljava/lang/reflect/Constructor;->getDeclaringClass()Ljava/lang/Class;

    move-result-object v3

    .line 113
    const-string v4, "Illegal arguments for constructor"

    .line 112
    invoke-direct {v2, v3, v4, v1}, Lorg/springframework/beans/BeanInstantiationException;-><init>(Ljava/lang/Class;Ljava/lang/String;Ljava/lang/Throwable;)V

    throw v2

    .line 115
    .end local v1           #ex:Ljava/lang/IllegalArgumentException;
    :catch_3
    move-exception v1

    .line 116
    .local v1, ex:Ljava/lang/reflect/InvocationTargetException;
    new-instance v2, Lorg/springframework/beans/BeanInstantiationException;

    invoke-virtual {v0}, Ljava/lang/reflect/Constructor;->getDeclaringClass()Ljava/lang/Class;

    move-result-object v3

    .line 117
    const-string v4, "Constructor threw exception"

    invoke-virtual {v1}, Ljava/lang/reflect/InvocationTargetException;->getTargetException()Ljava/lang/Throwable;

    move-result-object v5

    .line 116
    invoke-direct {v2, v3, v4, v5}, Lorg/springframework/beans/BeanInstantiationException;-><init>(Ljava/lang/Class;Ljava/lang/String;Ljava/lang/Throwable;)V

    throw v2
.end method

.method public static varargs instantiateClass(Ljava/lang/reflect/Constructor;[Ljava/lang/Object;)Ljava/lang/Object;
    .locals 5
    .parameter
    .parameter "args"
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "<T:",
            "Ljava/lang/Object;",
            ">(",
            "Ljava/lang/reflect/Constructor",
            "<TT;>;[",
            "Ljava/lang/Object;",
            ")TT;"
        }
    .end annotation

    .annotation system Ldalvik/annotation/Throws;
        value = {
            Lorg/springframework/beans/BeanInstantiationException;
        }
    .end annotation

    .prologue
    .line 133
    .local p0, ctor:Ljava/lang/reflect/Constructor;,"Ljava/lang/reflect/Constructor<TT;>;"
    const-string v1, "Constructor must not be null"

    invoke-static {p0, v1}, Lorg/springframework/util/Assert;->notNull(Ljava/lang/Object;Ljava/lang/String;)V

    .line 135
    :try_start_0
    invoke-static {p0}, Lorg/springframework/util/ReflectionUtils;->makeAccessible(Ljava/lang/reflect/Constructor;)V

    .line 136
    invoke-virtual {p0, p1}, Ljava/lang/reflect/Constructor;->newInstance([Ljava/lang/Object;)Ljava/lang/Object;
    :try_end_0
    .catch Ljava/lang/InstantiationException; {:try_start_0 .. :try_end_0} :catch_0
    .catch Ljava/lang/IllegalAccessException; {:try_start_0 .. :try_end_0} :catch_1
    .catch Ljava/lang/IllegalArgumentException; {:try_start_0 .. :try_end_0} :catch_2
    .catch Ljava/lang/reflect/InvocationTargetException; {:try_start_0 .. :try_end_0} :catch_3

    move-result-object v1

    return-object v1

    .line 138
    :catch_0
    move-exception v0

    .line 139
    .local v0, ex:Ljava/lang/InstantiationException;
    new-instance v1, Lorg/springframework/beans/BeanInstantiationException;

    invoke-virtual {p0}, Ljava/lang/reflect/Constructor;->getDeclaringClass()Ljava/lang/Class;

    move-result-object v2

    .line 140
    const-string v3, "Is it an abstract class?"

    .line 139
    invoke-direct {v1, v2, v3, v0}, Lorg/springframework/beans/BeanInstantiationException;-><init>(Ljava/lang/Class;Ljava/lang/String;Ljava/lang/Throwable;)V

    throw v1

    .line 142
    .end local v0           #ex:Ljava/lang/InstantiationException;
    :catch_1
    move-exception v0

    .line 143
    .local v0, ex:Ljava/lang/IllegalAccessException;
    new-instance v1, Lorg/springframework/beans/BeanInstantiationException;

    invoke-virtual {p0}, Ljava/lang/reflect/Constructor;->getDeclaringClass()Ljava/lang/Class;

    move-result-object v2

    .line 144
    const-string v3, "Is the constructor accessible?"

    .line 143
    invoke-direct {v1, v2, v3, v0}, Lorg/springframework/beans/BeanInstantiationException;-><init>(Ljava/lang/Class;Ljava/lang/String;Ljava/lang/Throwable;)V

    throw v1

    .line 146
    .end local v0           #ex:Ljava/lang/IllegalAccessException;
    :catch_2
    move-exception v0

    .line 147
    .local v0, ex:Ljava/lang/IllegalArgumentException;
    new-instance v1, Lorg/springframework/beans/BeanInstantiationException;

    invoke-virtual {p0}, Ljava/lang/reflect/Constructor;->getDeclaringClass()Ljava/lang/Class;

    move-result-object v2

    .line 148
    const-string v3, "Illegal arguments for constructor"

    .line 147
    invoke-direct {v1, v2, v3, v0}, Lorg/springframework/beans/BeanInstantiationException;-><init>(Ljava/lang/Class;Ljava/lang/String;Ljava/lang/Throwable;)V

    throw v1

    .line 150
    .end local v0           #ex:Ljava/lang/IllegalArgumentException;
    :catch_3
    move-exception v0

    .line 151
    .local v0, ex:Ljava/lang/reflect/InvocationTargetException;
    new-instance v1, Lorg/springframework/beans/BeanInstantiationException;

    invoke-virtual {p0}, Ljava/lang/reflect/Constructor;->getDeclaringClass()Ljava/lang/Class;

    move-result-object v2

    .line 152
    const-string v3, "Constructor threw exception"

    invoke-virtual {v0}, Ljava/lang/reflect/InvocationTargetException;->getTargetException()Ljava/lang/Throwable;

    move-result-object v4

    .line 151
    invoke-direct {v1, v2, v3, v4}, Lorg/springframework/beans/BeanInstantiationException;-><init>(Ljava/lang/Class;Ljava/lang/String;Ljava/lang/Throwable;)V

    throw v1
.end method
